﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;

namespace Husb.Data
{
    public interface IRepository<T> where T : class
    {
        
        
        //void Delete(Func<T, Boolean> predicate);
        //T GetById(long Id);
        //T GetById(string Id);
        //T Get(Func<T, Boolean> where);
        //IEnumerable<T> GetAll();
        //IEnumerable<T> GetMany(Func<T, bool> where);

        void Add(T entity);
        void Update(T entity);
        void Delete(T entity);
        void Delete(Expression<Func<T, bool>> where);
        T GetById(long id);
        T GetById(int id);
        T GetById(Guid id);
        T GetById(string id);

        int Count(Expression<Func<T, bool>> where = null);

        //T Get(Expression<Func<T, bool>> where);
        IEnumerable<T> GetAll();
        IEnumerable<T> GetMany(
            Expression<Func<T, bool>> where = null,
            Func<IQueryable<T>, IOrderedQueryable<T>> orderBy = null,
            string includeProperties = "");
        IEnumerable<T> GetPaged(int maximumRows = 20, int startRowIndex = 0,
            Expression<Func<T, bool>> where = null,
            Func<IQueryable<T>, IOrderedQueryable<T>> orderBy = null,
            string includeProperties = "");

        
    }
}
